<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>DM-CtrlH7-BF-DevProgram: C:/Users/ASUS/Desktop/dm-ctrlH7-balance-9025test/modules/motor/motor_def.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="50x5.png"/></td>
  <td id="projectalign">
   <div id="projectname">DM-CtrlH7-BF-DevProgram<span id="projectnumber">&#160;beta 0.1</span>
   </div>
   <div id="projectbrief">C.ONE Studio Damiao Development Board Framework</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.14.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search',true);
  $(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(function(){initNavTree('motor__def_8h.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">motor_def.h File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>电机通用的数据结构定义  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="controller_8h_source.html">controller.h</a>&quot;</code><br />
<code>#include &quot;stdint.h&quot;</code><br />
</div>
<p><a href="motor__def_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-nested-classes" class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:Motor_5FControl_5FSetting_5Fs" id="r_Motor_5FControl_5FSetting_5Fs"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_motor___control___setting__s.html">Motor_Control_Setting_s</a></td></tr>
<tr class="memitem:Motor_5FController_5Fs" id="r_Motor_5FController_5Fs"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_motor___controller__s.html">Motor_Controller_s</a></td></tr>
<tr class="memitem:Motor_5FController_5FInit_5Fs" id="r_Motor_5FController_5FInit_5Fs"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_motor___controller___init__s.html">Motor_Controller_Init_s</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">电机控制器初始化结构体,包括三环PID的配置以及两个反馈数据来源指针 如果不需要某个控制环,可以不设置对应的pid config 需要其他数据来源进行反馈闭环,不仅要设置这里的指针还需要在Motor_Control_Setting_s启用其他数据来源标志  <a href="struct_motor___controller___init__s.html#details">More...</a><br /></td></tr>
<tr class="memitem:Motor_5FInit_5FConfig_5Fs" id="r_Motor_5FInit_5FConfig_5Fs"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_motor___init___config__s.html">Motor_Init_Config_s</a></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-define-members" class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a1f51de96c4f8c9d729824a776dca074d" id="r_a1f51de96c4f8c9d729824a776dca074d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1f51de96c4f8c9d729824a776dca074d">LIMIT_MIN_MAX</a>(x,  min,  max)</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-enum-members" class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a306d656c63a2d986e7aff57a0526395d" id="r_a306d656c63a2d986e7aff57a0526395d"><td class="memItemLeft" align="right" valign="top"><a id="a306d656c63a2d986e7aff57a0526395d" name="a306d656c63a2d986e7aff57a0526395d"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a306d656c63a2d986e7aff57a0526395d">Closeloop_Type_e</a> { <br />
&#160;&#160;<b>OPEN_LOOP</b> = 0b0000
, <b>CURRENT_LOOP</b> = 0b0001
, <b>SPEED_LOOP</b> = 0b0010
, <b>ANGLE_LOOP</b> = 0b0100
, <br />
&#160;&#160;<b>SPEED_AND_CURRENT_LOOP</b> = 0b0011
, <b>ANGLE_AND_SPEED_LOOP</b> = 0b0110
, <b>ALL_THREE_LOOP</b> = 0b0111
<br />
 }</td></tr>
<tr class="memdesc:a306d656c63a2d986e7aff57a0526395d"><td class="mdescLeft">&#160;</td><td class="mdescRight">闭环类型,如果需要多个闭环,则使用或运算 例如需要速度环和电流环: CURRENT_LOOP|SPEED_LOOP <br /></td></tr>
<tr class="memitem:ac4dcec0ada61cfaf5b0bd6ced103d2e7" id="r_ac4dcec0ada61cfaf5b0bd6ced103d2e7"><td class="memItemLeft" align="right" valign="top"><a id="ac4dcec0ada61cfaf5b0bd6ced103d2e7" name="ac4dcec0ada61cfaf5b0bd6ced103d2e7"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>Feedfoward_Type_e</b> { <b>FEEDFORWARD_NONE</b> = 0b00
, <b>CURRENT_FEEDFORWARD</b> = 0b01
, <b>SPEED_FEEDFORWARD</b> = 0b10
, <b>CURRENT_AND_SPEED_FEEDFORWARD</b> = CURRENT_FEEDFORWARD | SPEED_FEEDFORWARD
 }</td></tr>
<tr class="memitem:a9bea14c1db85802fc7b8d059aab5725c" id="r_a9bea14c1db85802fc7b8d059aab5725c"><td class="memItemLeft" align="right" valign="top"><a id="a9bea14c1db85802fc7b8d059aab5725c" name="a9bea14c1db85802fc7b8d059aab5725c"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>Feedback_Source_e</b> { <b>MOTOR_FEED</b> = 0
, <b>OTHER_FEED</b>
 }</td></tr>
<tr class="memitem:a5809caac35d81e6de59426d04853eca1" id="r_a5809caac35d81e6de59426d04853eca1"><td class="memItemLeft" align="right" valign="top"><a id="a5809caac35d81e6de59426d04853eca1" name="a5809caac35d81e6de59426d04853eca1"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>Motor_Reverse_Flag_e</b> { <b>MOTOR_DIRECTION_NORMAL</b> = 0
, <b>MOTOR_DIRECTION_REVERSE</b> = 1
 }</td></tr>
<tr class="memitem:a87635b08479660ebabc11606fe05e385" id="r_a87635b08479660ebabc11606fe05e385"><td class="memItemLeft" align="right" valign="top"><a id="a87635b08479660ebabc11606fe05e385" name="a87635b08479660ebabc11606fe05e385"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>Feedback_Reverse_Flag_e</b> { <b>FEEDBACK_DIRECTION_NORMAL</b> = 0
, <b>FEEDBACK_DIRECTION_REVERSE</b> = 1
 }</td></tr>
<tr class="memitem:ad9dd6e91ab43b80f918ee1a46a24e29d" id="r_ad9dd6e91ab43b80f918ee1a46a24e29d"><td class="memItemLeft" align="right" valign="top"><a id="ad9dd6e91ab43b80f918ee1a46a24e29d" name="ad9dd6e91ab43b80f918ee1a46a24e29d"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>Motor_Working_Type_e</b> { <b>MOTOR_STOP</b> = 0
, <b>MOTOR_ENALBED</b> = 1
 }</td></tr>
<tr class="memitem:a6a6704f2a1361279d93acbd382716e62" id="r_a6a6704f2a1361279d93acbd382716e62"><td class="memItemLeft" align="right" valign="top"><a id="a6a6704f2a1361279d93acbd382716e62" name="a6a6704f2a1361279d93acbd382716e62"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>Motor_Type_e</b> { <br />
&#160;&#160;<b>MOTOR_TYPE_NONE</b> = 0
, <b>GM6020</b>
, <b>M3508</b>
, <b>M2006</b>
, <br />
&#160;&#160;<b>LK9025</b>
, <b>HT04</b>
<br />
 }</td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><p>电机通用的数据结构定义 </p>
<dl class="section author"><dt>Author</dt><dd>neozng </dd></dl>
<dl class="section version"><dt>Version</dt><dd>beta </dd></dl>
<dl class="section date"><dt>Date</dt><dd>2022-11-01</dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (c) 2022 HNU YueLu EC all rights reserved </dd></dl>
</div><a name="doc-define-members" id="doc-define-members"></a><h2 id="header-doc-define-members" class="groupheader">Macro Definition Documentation</h2>
<a id="a1f51de96c4f8c9d729824a776dca074d" name="a1f51de96c4f8c9d729824a776dca074d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f51de96c4f8c9d729824a776dca074d">&#9670;&#160;</a></span>LIMIT_MIN_MAX</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LIMIT_MIN_MAX</td>
          <td>(</td>
          <td class="paramtype"></td>          <td class="paramname"><span class="paramname"><em>x</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"></td>          <td class="paramname"><span class="paramname"><em>min</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"></td>          <td class="paramname"><span class="paramname"><em>max</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">(x) = (((x) &lt;= (min)) ? (min) : (((x) &gt;= (max)) ? (max) : (x)))</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="page-nav" class="page-nav-panel">
<div id="page-nav-resize-handle"></div>
<div id="page-nav-tree">
<div id="page-nav-contents">
</div><!-- page-nav-contents -->
</div><!-- page-nav-tree -->
</div><!-- page-nav -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a href="dir_e05d7e2b1ecd646af5bb94391405f3b5.html">modules</a></li><li class="navelem"><a href="dir_e1337f9400e8caa7f7e380800549fa55.html">motor</a></li><li class="navelem"><a href="motor__def_8h.html">motor_def.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0 </li>
  </ul>
</div>
</body>
</html>
